use std::rc::Rc;
use crate::business::websocket::service::syn_data_service::SynDataConfig;

pub struct PullEndCallback<T> {
    pub callback: Rc<dyn Fn(SynDataConfig<T>)>,
}

impl<T> PullEndCallback<T> {

    pub fn do_callback(self: &Self, syn_data_config: SynDataConfig<T>) {
        (*self.callback)(syn_data_config);
    }
}

impl<T> Clone for PullEndCallback<T> {
    fn clone(&self) -> Self {
        PullEndCallback { callback: self.callback.clone() }
    }
}